home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr42 / smixc111.zip / SMIXC111.DOC < prev    next >
Text File  |  1995-02-15  |  7KB  |  133 lines

  1.             _____      __    __     ____     __   __       ______
  2.            /  _  \    |  \  /  |   |    |   |  \ /  |     /  __  \
  3.           |  / \__|   |   \/   |    |  |     \  ~  /     |  /  \__|
  4.           |  \___     |        |    |  |      |   |      | |
  5.            \___  \    |  /\/\  |    |  |      |   |      | |
  6.            __  \  |   |  |  |  |    |  |      |   |      | |     _
  7.           |  \_/  |   |  |  |  |    |  |     /  ^  \     |  \___/ |
  8.            \_____/    |__|  |__|   |____|   |__/ \__|     \______/
  9.  
  10.                                Version 1.11
  11.                     Written by Ethan Brodsky (2/15/95)
  12.           Copyright 1995 by Ethan Brodsky.  All rights reserved.
  13.  
  14. This library is distributed AS IS.  The author specifically disclaims
  15. responsibility for any loss of profit or any consequential, incidental,
  16. or other damages.  SMIXC is freeware and is distributed with full Turbo
  17. Pascal source code, which is copyright by Ethan Brodsky.  You are free
  18. to incorporate the code in full or part into your own programs as long
  19. as credit is given to Ethan Brodsky.  The source code may be distributed
  20. in its original form only, including this documentation file.
  21.  
  22. ------------------------------------------------------------------------
  23.  
  24. You may have used my SBVOX and SBDSP units.  They both played one VOC
  25. file at a time.  The whole VOC file had to be loaded into conventional
  26. memory, taking valuable memory from a real mode program.
  27.  
  28. SMIXC will play up to 8 sounds at one time.  The sounds are stored in
  29. extended memory and copied to a small buffer as needed.  It should work
  30. with any Sound Blaster compatible sound card.  It uses auto-initialized
  31. DMA if a SBPro or higher is installed, eliminating clicks between blocks.
  32. On a SB16 is installed, it will use 16-bit sound output, increasing the
  33. sound quality.  Full Borland C source is included and it is identical in
  34. functionality and implementation to the Turbo Pascal version.
  35.  
  36. The sounds are stored on disk as raw signed 8-bit sample data, at a
  37. sampling rate of 22050 HZ.  There are two options for usage of XMS:
  38.   1)  Each sound can be stored in its own extended memory block.  This
  39.       allows random allocation and deallocation of sounds.  Each sound
  40.       uses an extended memory handle.  The default HIMEM configuration
  41.       has only 32 handles, so the maximum number of sounds that can be
  42.       loaded is 32.  (Less if TSRs or other drivers use handles)  This
  43.       is the default mode.
  44.   2)  All sounds can be loaded into one extended memory block.  Sounds
  45.       can be loaded one at a time, but all sounds must be deallocated
  46.       at once.  Initialize this mode by calling InitSharing before
  47.       allocating any sounds.  Sounds should be allocated and freed as
  48.       usual by using the LoadSound and FreeSound procedures, but all
  49.       extended memory will remain allocated until ShutdownSharing is
  50.       called.
  51.  
  52. Please test test this on your setup (Especially if you have a Sound
  53. Blaster compatible, a SB on IRQ10, or something out of the ordinary)
  54. and report any imcompatibilities to me.  I have reports that it worked
  55. on sound cards including a ThunderBoard and a AWE32, and under Windows
  56. NT 3.5 and OS/2 Warp.
  57.  
  58. As the block size is increased, the sound latency will also increase.
  59. New sound effects are only started at the beginning of each block, so
  60. a block size of 256 gives a latency of about 1/85 of a second.  This
  61. is the maximum time that can pass between when the StartSound procedure
  62. is called and when the sound starts playing.  A larger block size also
  63. means that more conventional memory is needed for buffers.  (7*BlockSize
  64. bytes with 8-bit output, and 11*BlockSize with 16-bit output)  I would
  65. recommend a block size between 128 and 1024 bytes.  In case you are
  66. wondering about the three counters displayed by the test program, the
  67. first one counts in the CPU's free time, the second counts the number of
  68. interrupts that have occurred, and the third is the number of sounds
  69. currently being played.  If you have an incompatibility problem, please
  70. tell me what each counter is doing.
  71.  
  72. This library will work in a real-mode IDE but requires a little work
  73. to get it to work in the protected mode IDE.  By default, the IDE's DPMI
  74. extender uses all extended memory.  The demo requires 190k of extended
  75. memory, and any programs using SMIXC require extended memory to hold all
  76. the sounds.  You can decrease the amount of extended memory used by the
  77. IDE by setting the DPMIMEM environment variable:
  78.   SET DPMIMEM=MAXMEM x
  79. where x is the number of kilobytes of extended memory to use for the
  80. IDE.  You will have to find a balance between memory left over for your
  81. program and memory available for IDE use.  (Source code, online help,
  82. compilation...)  It is very important to deallocate extended memory on
  83. program termination.  The run-time library will free the heap, but extended
  84. memory is left allocated.  The handles and memory will be lost until the
  85. next reboot.  It is not enough just to deallocate XMS at the end of your
  86. code, because a run-time error or exit() will stop execution before the
  87. memory has been deallocated.  I would recommend using an exit procedure
  88. to deallocate memory, as demonstrated in the example program.
  89.  
  90. SMIXC uses a raw 8-bit unsigned file format.  I have included a program
  91. that will convert WAV files to the raw format necessary.  The WAV files
  92. must be 8-bit and sampled at 22050 HZ, or the output will be distorted.
  93.  
  94. I have several improvements planned, but I need feedback.  If you are
  95. using my code, I would greatly appreciate it if you would mail me and
  96. tell me about it.  If you have any bug reports, suggestions, or have
  97. made improvements, please tell me!  I also have finished a FM synthesis
  98. MIDI music library and am working on a digital music library, so tell me
  99. what you want!
  100.  
  101. This library is freeware, but I would appreciate contributions so I can
  102. continue to buy development kits and upgrade my computer.  You don't
  103. NEED to send me anything, but if you are making of money by using this,
  104. please send whatever you feel it is worth.
  105.  
  106. Features:
  107.   * Up to 8 sounds played simultaneously
  108.   * Sampling rate of 22050 HZ
  109.   * Autoinitialized DMA prevents clicking
  110.   * 16-bit sound output increases quality
  111.   * Mixes in the background using a fraction of CPU time
  112.   * Sounds stored in extended memory
  113.  
  114. ------------------------------------------------------------------------
  115.  
  116. There are several ways to contact me:
  117.     E-Mail:  ericbrodsky@psl.wisc.edu (Best)
  118.     Phone:   (608) 238-4830
  119.     Mail:
  120.         Ethan Brodsky
  121.       4010 Cherokee Dr.
  122.       Madison, WI 53711
  123.  
  124. Bug fixes and other announcements will be posted in:
  125.     alt.sb.programmer
  126.     comp.sys.ibm.pc.soundcard.tech
  127.     rec.games.programmer
  128. Up-to-date versions may be downloaded from:
  129.     x2ftp.oulu.fi /pub/msdos/programming/mxlibs/smix*.zip
  130.       (The directory structure there is currently being reorganized)
  131.  
  132. Revision history:
  133.  1.11  - Initial release corresponding with SMIX (Pascal) v1.11